package models

//定义请求的参数结构体
//入参

// ParamSignUp 注册参数
type ParamSignUp struct {
	Username   string `json:"username" binding:"required"`
	Password   string `json:"password"  binding:"required"`
	RePassword string `json:"re_password"  binding:"required,eqfield=Password"`
}

//ParamLogin 登录请求参数
type ParamLogin struct {
	Username string `json:"username" binding:"required"`
	Password string `json:"password"  binding:"required"`
}

type ParamVoteData struct {
	//UserID从请求中获取当前的用户
	PostID    string `json:"post_id" binding:"required"`               //帖子id
	Direction int8   `json:"direction,string" binding:"oneof=1 0 -1" ` //赞成票(1)还是反对票(-1)
}

//ParamPostList 获取帖子列表query string参数
type ParamPostList struct {
	CommunityId int64 `json:"community_id" form:"community_id"`
	Page  int64  `json:"page" form:"page"`
	Size  int64  `json:"size" form:"size"`
	Order string `json:"order" form:"order"`
}

//ParamCommunityPostList 按社区获取帖子列表query string参数
/*type ParamCommunityPostList struct {
	ParamPostList *ParamPostList

}*/
const (
	OrderTime  = "time"
	OrderScore = "score"
)